{layout name="layout2" /}
<link rel="stylesheet" href="/static/admin/css/goods.css" media="all">
<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title" style="background-color: #f3f5f9">
        <li class="goods-tab layui-this" style="color: #6a6f6c">基础设置</li>
        <!--     <li class="goods-tab" style="color: #6a6f6c">价格库存</li>
            <li class="goods-tab" style="color: #6a6f6c">商品详情</li>
            <li class="goods-tab" style="color: #6a6f6c">销售设置</li> -->
    </ul>
    <div class="layui-tab-content layui-form">
        <div class="layui-tab-item goods-content layui-show">
            <div class="layui-card-body" pad15>
                <div lay-filter="">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品名称：</label>
                        <div class="layui-input-block">
                            <input name="goods_id" type="hidden">
                            <input type="text" name="name" readonly lay-verify="custom_required" lay-verType="tips"
                                   autocomplete="off"
                                   switch-tab="0" verify-msg="请输入商品名称，最多64个字符" placeholder="请输入商品名称，最多64个字符"
                                   class="layui-input" value='{$info["base"]["name"]}'>
                        </div>
                    </div>
                    <!--   <div class="layui-form-item">
                          <label class="layui-form-label">商品编码：</label>
                          <div class="layui-input-block">
                              <input type="text" name="code" lay-verType="tips" autocomplete="off" switch-tab="0" class="layui-input">
                          </div>
                      </div> -->
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">商品分类:</label>
                            <div class="layui-input-block">
                                <select name="category_id" placeholder="请选择商品分类">
                                    <option value="$info['base']['first_category_id']">{$category_lists[$info['base']['first_category_id']]['name']}</option>
                                    {foreach $category_lists as $val }
                                    <option value="{$val.id}">{$val.name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">二级分类:</label>
                            <div class="layui-input-block">
                                <select name="second_category_id" id="second_category_id" placeholder="请选择分类">
                                    <option value="$info['base']['second_category_id']">{$category_lists[$info['base']['second_category_id']-1]['name']}</option>
                                    {foreach $category_lists as $val }
                                    <option value="{$val.id}">{$val.name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">商品描述：</label>
                        <div class="layui-input-block">
                            <input type="text" maxlength="32" name="remark" value="{$info['base']['remark']}"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">基地图片：</label>
                        <div class="layui-input-block">

                            <div class="img-container">
                                <img class="img-src" src="{$info['base']['image']}">
                                <a class="img-del-x">x</a>
                            </div>

                        </div>
                    </div>
                </div>

                <!-- <div class="layui-form-item" style="margin-bottom: 0px">
                    <label class="layui-form-label"><span class="form-label-asterisk">*</span>商品轮播图：</label>
                    <div class="" style="height:80px;line-height:80px">
                        <ul>
                        </ul>
                        <div class="goods-img-add" lay-verify="goods_image" lay-verType="tips" switch-tab="0"
                             verify-msg="至少选择一张图片"></div>
                        <br>
                    </div>
                </div> -->
                <div class="layui-form-item"><label class="layui-form-label"></label><span
                        style="color: #a3a3a3;font-size: 9px">建议尺寸：800*800像素</span></div>
                <!--   <div class="layui-form-item">
                      <label class="layui-form-label">商品品牌：</label>
                      <div class="layui-input-inline">
                          <select name="brand_id" lay-verType="tips" switch-tab="0" verify-msg="请选择商品品牌">
                              <option value="">请选择品牌</option>

                          </select>
                      </div>
                  </div> -->
                <div class="layui-form-item">
                    <label class="layui-form-label">商品平台：</label>
                    <div class="layui-input-block">
                        <select name="platform">
                            {if {$info['base']['platform'] ==1 }}
                            <option value="1">抖音</option>
                            {if/}
                            {if {$info['base']['platform'] ==2 }}
                            <option value="2">快手</option>
                            {if/}
                            {if {$info['base']['platform'] ==3 }}
                            <option value="3">天猫</option>
                            {if/}
                            <!-- <option value="">请选择平台</option>
                            <option value="1">抖音</option>
                            <option value="2">快手</option>
                            <option value="3">天猫</option> -->
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">商品链接：</label>
                    <div class="layui-input-block">
                        <input type="text" maxlength="1000" name="goods_links" value="{$info['base']['goods_links']}"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品福利：</label>
                    <div class="layui-input-block">
                        <input type="text" maxlength="1000" name="welfare" value="{$info['base']['welfare']}"
                               autocomplete="off" class="layui-input">
                        <!-- <select name="welfare" xm-select="welfare" xm-select-search="" xm-select-search-type="dl" xm-select-skin="normal">
                            <option value="">请选择福利</option>
                            <option value="1">赠品</option>
                            <option value="2">投流</option>
                            <option value="3">直播间福利</option>
                        </select> -->
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品佣金比例：</label>
                    <div class="layui-input-block">
                        <input type="text" maxlength="32" value="{$info['base']['commission']}" name="commission"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品优惠卷价格：</label>
                    <div class="layui-input-block">
                        <input type="text" maxlength="32" name="coupon" value="{$info['base']['coupon']}"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品最终价格：</label>
                    <div class="layui-input-block">
                        <input type="text" maxlength="32" name="good_price" value="{$info['base']['good_price']}"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <!--<div class="layui-form-item" style="text-align: center">-->
                <!--<input type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="goods-submit-edit" id="goods-submit-edit" value="确认">-->
                <!--</div>-->
            </div>
        </div>
        <style>
            .layui-form-label {
                width: 100px;
            }

            .layui-input-block {
                margin-left: 130px;
            }
        </style>
        <link rel="stylesheet" href="/static/plug/formSelects/formSelects-v4.css"/>
        <script src="/static/plug/formSelects/formSelects-v4.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
            layui.config({
                version: "{$front_version}",
                base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
            }).extend({
                index: 'lib/index' //主入口模块
            }).use(['index', 'element', 'jquery', 'like', 'likeedit'], function () {
                var $ = layui.$;
                var like = layui.like;
                var form = layui.form;
                var likeedit = layui.likeedit;

                form.on('submit(goods-submit-edit)', function (data) {
                    var field = data.field;
                    parent.layer.close(index);//关闭当前页
                    // like.ajax({
                    //     url: '{:url("goods/edit")}',
                    //     data: field,
                    //     type: "post",
                    //     success: function (res) {
                    //         if (res.code == 1) {
                    //             layui.layer.msg(res.msg, {
                    //                 offset: '15px'
                    //                 , icon: 1
                    //                 , time: 1000
                    //             }, function () {
                    //                 var index = parent.layer.getFrameIndex(window.name);

                    //             });

                    //         }
                    //     }
                    // });
                });


            });
        </script>